<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>旅行日记</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="<?php echo base_url('static/css/bootstrap.min.css'); ?>" rel="stylesheet" media="screen">
    <link href="<?php echo base_url('static/css/style.css'); ?>" rel="stylesheet" media="screen">
    <style>


    </style>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="brand" href="index.html">旅行日记</a>

            <div class="nav-collapse collapse">

                <?php if(isset($_SESSION['islogin']) && $_SESSION['islogin']==1){?>
                <p class="userinfo pull-right">
                    <a href="#" class="text-warning"><?php echo $_SESSION['username'] ?></a>
                    <a class="btn-small btn-success" href="<?php echo base_url("main/loginout");?>" role="button"> 退出</a>
                </p>
                <?php }else{?>
                <form action="<?php echo base_url("User_login/login");?>" method="post" class="navbar-form pull-right">
                    <input class="span2" type="text" name="username" placeholder="Email">
                    <input class="span2" type="password" name="password" placeholder="Password">
                    <button type="submit" class="btn">登录</button>
                    <a href="<?php echo base_url("user_reg/index");?>" class="btn btn-success">注册</a>
                </form>
                <?php }?>
            </div>
        </div>
    </div>
</div>

<div class="container">
    <div class="row-fluid">

        <div class="article-list span9">
            <img src="<?php echo base_url('static/images/banner.png'); ?>">
            <?php foreach($article as $item){?>
            <div class="row-fluid">
                <h2><a href="<?php echo base_url("article/index");?>"><?php echo $item['title']; ?></a></h2>

                <h3>David 发表于: <?php echo $item['pubtime']; ?></h3>

                <p><?php echo $item['description']; ?></p>

                <p><a class="btn" href="<?php echo base_url("article/index");?>">查看更多 &raquo;</a></p>
            </div>
            <?php } ?>
            <div class="pagination pagination-centered">
                <?php echo $page_link; ?>
<!--                <ul>
                    <li><a href="#">Prev</a></li>
                    <li class="active"><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">5</a></li>
                    <li><a href="#">Next</a></li>
                </ul>-->
            </div>
        </div>
        <!--/span-->

        <div class="span3">
            <div class="well sidebar-nav">
                <ul class="nav nav-list">
                    <li class="nav-header">按日期</li>
                    <li><a href="#">一月</a></li>
                    <li><a href="#">二月</a></li>
                    <li><a href="#">三月</a></li>

                    <li class="nav-header">标签</li>
                    <li class="active"><a href="#">厦门</a></li>
                    <li><a href="#">台湾</a></li>
                    <li><a href="#">深圳</a></li>
                    <li><a href="#">香港</a></li>
                    <li><a href="#">新加坡</a></li>
                </ul>
            </div>
            <!--/.well -->
        </div>
        <!--/span-->
    </div>
    <!--/row-->
    <hr>
    <footer>
        <p>&copy; Copyright 2015 </p>
    </footer>
</div>
<script src="<?php echo base_url('static/js/bootstrap.min.js'); ?>"></script>
</body>
</html>